
--[[
	**********************
	* SvFrame - thomasfn *
	**********************
	SvPlayer.lua - Loads player components
]]

hooks.Add( "player.authenticate", "SvFrame_Player_Auth", function( ply ) svr.ApplyMetatable( ply, "player" ) end )

local meta = svr.Metatable( "player" )

function meta:ChatPrint( ... )
	svr.ChatPrint( self, ... )
end

function meta:SetPData( key, val )
	svr.SetPlayerPData( self, key, val )
end

function meta:GetPData( key, t )
	return svr.GetPlayerPData( self, key, t )
end

function meta:GetPDataN( key )
	return self:GetPData( key, "number" )
end

function meta:GetPDataS( key )
	return self:GetPData( key, "string" )
end

function meta:GetPDataB( key )
	return self:GetPData( key, "boolean" )
end

function meta:GetGroup()
	return svr.GetPlayerGroup( self )
end

function meta:SetGroup( name )
	svr.SetPlayerGroup( self, name )
end

function meta:GetColour()
	return svr.GetPlayerColour( self )
end

function meta:Name()
	return self:GetColour() .. "^" .. self.Username .. COL_WHITE .. "^"
end

function meta:HasFlag( flag )
	return svr.PlayerHasFlag( flag )
end